﻿@model AncientLand.Service.Entity.Photos
@{   
    Layout = "~/Views/Shared/_AdminLayoutPage.cshtml";
}
<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>
<script type="text/javascript" src="@Url.Content("~/Scripts/Uploadify/swfobject.js")"></script>
<script type="text/javascript" src="@Url.Content("~/Scripts/Uploadify/jquery.uploadify.v2.1.0.min.js")"></script>
<style type="text/css">
.gallery li img 
{
    height:90px;
    width:160px;
 }
</style>

<div class="grid_12 widget first">
    <div class="widget_title clearfix">
        <h2>
            修改上传的图片</h2>
        <ul>
            <li class="ui-state-default ui-corner-top ui-tabs-selected ui-state-active"><a href="@Url.Content("~/HomePage/DeleteImages/" + Model.Id)" id="btnDelete">
                <span>删除该图片</span></a> </li>
             <li class="ui-state-default ui-corner-top ui-tabs-selected ui-state-active"><a href="@Url.Content("~/HomePage/UploadImages")" id="btnAdd">
                <span>上传新图片</span></a> </li>       
            <li class="ui-state-default ui-corner-top ui-tabs-selected ui-state-active"><a href="@Url.Content("~/HomePage/Images")" >
                <span>返回图片列表</span></a> </li>
        </ul>
    </div>
    <div class="widget_body">
        @using (Html.BeginForm())
        {
            
            <table class="simple">
                <tbody>
                    <tr>
                        <td>
                            @Html.LabelFor(model => model.Title):
                        </td>
                        <td colspan="2">
                            @Html.TextBoxFor(model => model.Title, new { style = "width:613px" })
                            <br />@Html.ValidationMessageFor(model => model.Title)
                        </td>
                    </tr>
                    <tr>
                        <td>
                            @Html.LabelFor(model => model.Content):
                        </td>
                        <td colspan="2">
                            @Html.TextAreaFor(model => model.Content, new { rows = "5", id = "news-content", style = "width: 613px;height:100px" })
                            <br />@Html.ValidationMessageFor(model => model.Content)
                        </td>
                    </tr>
                    <tr>
                        <td>
                        </td>
                        <td>
                            <label for="photos">
                                选择要上传的图片【图片大小：宽568px*高400px】：</label>
                        </td>
                        <td rowspan="3" style="width: 270px; vertical-align: top; color: Red; font-weight: bold">
                            @Html.ValidationSummary(true)
                        </td>
                    </tr>
                    <tr>
                        <td>
                            @Html.HiddenFor(model => model.ImgPath)
                            @Html.HiddenFor(model => model.ThumbnailPath)
                        </td>
                        <td>
                            <p>
                                <input id="fileInput1" name="fileInput1" type="file" /></p>
                            <p style="margin-top: 5px; font-size: 14px; font-weight: bold;">
                                <span id="result"></span>
                            </p>
                        </td>
                    </tr>
                    <tr>
                        <td>
                        </td>
                        <td>
                            <a href="javascript:if(checkImport()){$('#fileInput1').uploadifyUpload();}" class="btn  large grey">
                                上传图片</a>
                            <input type="submit" value="【保 存】" id="submit" />
                        </td>
                    </tr>
                </tbody>
            </table>
        }
    </div>
</div>
<div class="grid_4 widget">
    <div class="widget_title clearfix">
        <h2>
            图片预览</h2>
    </div>
    <div class="widget_body">
        <div class="widget_content">
            <ul class="gallery">
                <li><a title="@Model.Content" href="@Url.Content("~" + Model.ImgPath)" rel="prettyPhoto[HomePage]" id="previewLink">
                    <img alt="@Model.Title" src="@Url.Content("~" + Model.ThumbnailPath)" id="previewImage" /></a>
                </li>
                <div class="clear">
                </div>
            </ul>
        </div>
    </div>
</div>
<div class="clear">
    <div id="dialog" title="提示">
        <p>
            请先上传图片!</p>
    </div>
</div>
@{Html.RenderPartial("_HomePageImagesScript");}
